import { Component, OnInit } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';

@Component({
  selector: 'app-business-refund-confirmed-detail',
  templateUrl: './detail.component.html'
})
export class BusinessRefundConfirmedDetailComponent implements OnInit {
  i: any = {};
  detail: any = undefined;

  constructor(private modal: NzModalRef, private msgSrv: NzMessageService, private http: _HttpClient) {}

  ngOnInit(): void {
    console.log(this.i);
    this.http.get(`api/refund_detail`, { shopId: this.i.shopId, refundOrderNumber: this.i.refundOrderNumber }).subscribe(res => {
      if (res.err_code != 0) {
        this.msgSrv.error(res.msg);
        this.detail = undefined;
      } else {
        this.detail = res.data;
      }
    });
  }

  close(): void {
    this.modal.destroy();
  }
}
